package MULE.Model.Logic;

import javax.swing.JPanel;
import java.awt.event.ActionListener;

/**
 * Represents a presenter object in the game of MULE. Mule presenters know how
 * to show their associated views.
 * 
 * @author jstep
 */
public abstract class MulePresenter implements ActionListener {

	protected JPanel view;

	/**
	 * Creates a new MULE presenter with associated view.
	 * 
	 * @param view
	 *            Presenter's associated view.
	 */
	public MulePresenter(JPanel view) {
		this.view = view;
	}

	/**
	 * Returns a reference to this presenter's view.
	 * 
	 * @return Reference to this presenter's view.
	 */
	public JPanel getView() {
		return this.view;
	}

	/**
	 * Tells the application to show the view associated with this presenter.
	 */
	public void showView() {
		MuleDriver.setView(this.view);
	}
}
